package com.pengyang.netty.demo.pojo;

import org.msgpack.annotation.Message;

@Message
public class IMMessage {
 
    //用户ID
    private int uid;
 
    //消息类型 0：登录 1:退出  2：文字消息   3：空消息  4：音频   5：视频
    private byte msgType;
 
    //接收方
    private int receiveId;
 
    //消息内容
    private String msg;
 
    public IMMessage(){
 
    }
 
    /**
     * 构造方法
     * @param appId     应用通道
     * @param version   应用版本
     * @param uid       用户ID
     * @param msgType   消息类型
     * @param receiveId 消息接收者
     * @param msg       消息内容
     */
    public IMMessage( int uid, byte msgType, int receiveId, String msg) {
        this.uid = uid;
        this.msgType = msgType;
        this.receiveId = receiveId;
        this.msg = msg;
    }
 
    public int getUid() {
        return uid;
    }
 
    public void setUid(int uid) {
        this.uid = uid;
    }
 
    public byte getMsgType() {
        return msgType;
    }
 
    public void setMsgType(byte msgType) {
        this.msgType = msgType;
    }
 
    public int getReceiveId() {
        return receiveId;
    }
 
    public void setReceiveId(int receiveId) {
        this.receiveId = receiveId;
    }
 
    public String getMsg() {
        return msg;
    }
 
    public void setMsg(String msg) {
        this.msg = msg;
    }

	@Override
	public String toString() {
		return "IMMessage [uid=" + uid + ", msgType=" + msgType + ", receiveId=" + receiveId + ", msg=" + msg + "]";
	}
 
}
